package com.frx.datastruct.chapterseven;

import java.util.ArrayList;

/**
 * Created by xurenfeng on 2019/3/5.
 */
public class SetTest {

    private static final String FILE_PATH = "D:\\Users\\My\\JavaDataStruct\\src\\com\\frx\\pride-and-prejudice.txt";
    public static void main(String[] args){
        System.out.println("pride-and-prejudice");
        ArrayList<String> words = new ArrayList<>();
        if (FileOperation.readFile(FILE_PATH,words)){
            System.out.println("Total words:" + words.size());

            //BSTSet<String> bstSet = new BSTSet<>();
            LinkedListSet<String> listSet = new LinkedListSet<>();
            for (String word : words){
                //bstSet.add(word);
                listSet.add(word);
            }
            System.out.println("total different words:" + listSet.getSize());
        }
    }
}
